<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>方维网站后台管理系统_深圳网站建设</title>
    <meta name="author" content="深圳方维网络科技有限公司 http://www.szfangwei.cn" />
    <import type="css" file="admin/css/index" />
    <import type="js" file="common/jquery171min" />
    <import type="css" file="common/uploadify/uploadify" />
    <script language="javascript" type="text/javascript">
        document.write("<script type='text/javascript' " + "src='__PUBLIC__/common/uploadify/min.js?" + new Date() + "'></s" + "cript>");
    </script>
</head>
<body>
    <div style="padding-top:40px;width:80px;margin:0px auto;">
        <input type="file" id="upload" name="upload" />
    </div>
    <script src="__PUBLIC__/common/artDialog4.1.7/artDialog.source.js?skin=blue"></script>
    <script src="__PUBLIC__/common/artDialog4.1.7/plugins/iframeTools.source.js"></script>
    <script type="text/javascript">
        var path = '{$path}';
        var thumbw = '{$thumbw}';
        var thumbh = '{$thumbh}';
        var parent_id = '{$parent_id}';
            $('#upload').uploadify({
                'swf': '__PUBLIC__/common/uploadify/uploadify.swf")',
                'uploader': "{:U('Fwadmin/Login/uploadPic')}?path="+path+"&thumbw="+thumbw+"&thumbh="+thumbh+"&sessionid={:session_id()}",
                'cancelImg': '__PUBLIC__/common/uploadify/uploadify-cancel.png',
                'buttonText': '选择图片',
                'auto': true,
                'height': 24,
                'width': 80,
                'multi': false,
                'fileTypeDesc': '图片文件',
                'fileTypeExts': '*.jpg;*.gif;*.png;*.bmp;',
                'fileSizeLimit': '2024KB',
                'removeTimeout': 0,
                'onUploadError': function(file, errorCode, errorMsg, errorString, swfuploadifyQueue) {
                    if (errorCode !== "-280" && errorMsg !== "File Upload Cancelled.")
                    {
                        alert(errorMsg);
                    }
                },
                'onCancel': function(event, queueID, file, data) {
                    //  alert("取消成功！");
                },
                'onUploadSuccess': function(file, data, response) {
                    if (response == true) {
                        var json = eval('(' + data + ')');
                        var top = art.dialog.top;
                        top.show_upload_img(parent_id,'__ROOT__' + json.SaveName);
                        var api = art.dialog.open.api;
                        api.close();
                    }
                    else {
                        alert("上传出错！");
                    }
                }
            });

    </script>
</body>
</html>
